package HomeWork3_24;

public class HomeWork3_24_1 {
    private static boolean isprim(int x){
        if(x == 1)
            return false;
        for(int i = 2;i*i <= x;i++){
            if(x%i == 0)
                return false;
        }
        return true;
    }
    public static void main(String[] args) {
        int sum = 0;
        System.out.println("100内的素数：");
        for(int i = 1;i <= 100;i++){
            if(isprim(i)){
                System.out.println(i);;
                sum += i;
            }
        }
        System.out.println("素数和sum = " + sum);
    }
}
